<template>
  <view class="container">
    <my-navbar-top></my-navbar-top>
    <view class="logistics-detail">
      <view class="header">物流详情</view>
      <view class="box">
        <logistics
          :list="logisticsTraceDetailList"
          :deliver="deliver"
        ></logistics>
      </view>
    </view>
  </view>
</template>

<script>
import logistics from '@/components/logistics.vue'
export default {
  name: 'Logistics',
  components: {
    logistics,
  },
  data() {
    return {
      order_id: '',
      logisticsTraceDetailList: [],
      // 物流信息
      deliver: {},
    }
  },
  onLoad(options) {
    this.order_id = options.order_id
    if (this.order_id) {
      this.getDetail()
    }
  },
  methods: {
    getDetail() {
      this.$api
        .logisticsInfo({
          order_id: this.order_id,
        })
        .then((res) => {
          console.log(res)
          this.logisticsTraceDetailList =
            res.data.logisticsTraceDetailList || []

          this.deliver = {
            deliver_number: res.data.order.deliver_number,
          }
        })
    },
  },
}
</script>

<style lang="scss" scoped>
@import './index.scss';
</style>
